#define navbar(activePage)
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
	<a class="navbar-brand" href="#">MGO</a>
	#if(currentUser != null)
	<ul class="navbar-nav mr-auto">
		<li class="nav-item #(activePage=='stage'?'active':'')"><a class="nav-link" href="#(homeurl ??)/stage">关卡</a></li>
		<li class="nav-item #(activePage=='team'?'active':'')"><a class="nav-link" href="#(homeurl ??)/team">编队</a></li>
		<li class="nav-item #(activePage=='detail'?'active':'')"><a class="nav-link" href="#(homeurl ??)/detail">一览</a></li>
		<li class="nav-item #(activePage=='summon'?'active':'')"><a class="nav-link" href="#(homeurl ??)/summon">召唤</a></li>
		<li class="nav-item #(activePage=='shop'?'active':'')"><a class="nav-link" href="#(homeurl ??)/shop">商店</a></li>
		<li class="nav-item #(activePage=='news'?'active':'')"><a class="nav-link" href="#(homeurl ??)/news">公告 <span class="badge" id="newsCount"></span></a></li>
		<li class="nav-item #(activePage=='setting'?'active':'')"><a class="nav-link" href="#(homeurl ??)/setting">设置</a></li>
	</ul>
	<ul class="navbar-nav">
		<li class="nav-item"><span class="navbar-brand">#(currentUser.nickname ??)</span></li>
		<li class="nav-item"><span class="navbar-brand">☯<span id="userStone">#(currentUser.stone ??)</span></span></li>
		<li class="nav-item"><button id="logout" type="button" class="btn btn-info navbar-btn">退出</button></li>
	</ul>
	#end
</nav>
<script type="text/javascript">
	$("#logout").click(function(e){
		$.post("#(homeurl ??)/account/logout",function(data){
			location.reload();
		});
	});
	
	function updateUserStone(){
		$.post("#(homeurl ??)/account/getStone",function(data){
			if(data.isOk){
				$("#userStone").text(data.stone);
			}
		})
	}

	#if(currentUser != null)
	$(function(){
		$.post("#(homeurl ??)/news/getLatestNewsCount",function(data){
			if(data.isOk){
				$("#newsCount").text(data.msg);
			}
		});
	});
	#end
</script>
#end